package example.strategy.irreversible;

import com.scop.desensitize.encry.irreversible.AbstractIRreversibleEncry;
import com.scop.desensitize.exception.factory.FactoryException;
import com.scop.desensitize.exception.strategy.EncodeException;
import com.scop.desensitize.factory.encry.EStrategy;
import com.scop.desensitize.factory.encry.irreversible.IrreverSibleFactory;
import org.apache.log4j.Logger;

import java.security.NoSuchAlgorithmException;

public class HmacDemo {
    public static Logger log = Logger.getLogger(HmacDemo.class);
    public static void main(String[] args) throws NoSuchAlgorithmException, EncodeException, FactoryException {
        AbstractIRreversibleEncry encry = IrreverSibleFactory.create(EStrategy.HMAC);
        //加密
        String encryption =(String) encry.encode("hello world");
        log.info("加密后："+encryption);
    }
}
